<?php
session_start();
require_once("include/ui.php");

date_default_timezone_set('UTC');

if (!(isset($_SESSION['adminid']))){
        echo "<meta http-equiv = refresh ; content = '0 ; url = index.php'>";
}

$_s_date = date("d/m/Y",mktime(0, 0, 0, date("m"), 1,   date("Y")));
$_e_date = date("d/m/Y", mktime(0, 0, 0, date("m") +1, 0,   date("Y")));
 
 
// show header
echo headerPage("CD Hidef-Backend");
?>
 <SCRIPT src="js/js_main.js"></SCRIPT> 
 <script>
$(function() {
 
    
    $( "#txtOrderFrom" ).datepicker({ dateFormat: 'dd/mm/yy',
        showOn: "button",
        changeMonth: true,
        changeYear: true,
        yearRange:'c-10:c+1',       
        buttonImage: "images/Calendar.png",
        buttonImageOnly: true });
                
    $( "#txtOrderTo" ).datepicker({ dateFormat: 'dd/mm/yy',
        showOn: "button",
        changeMonth: true,
        changeYear: true,
        yearRange:'c-10:c+1',           
        buttonImage: "images/Calendar.png",
        buttonImageOnly: true });
        
        $("#txtExDateFrom").datepicker().datepicker('disable');
        $("#txtExDateTo").datepicker().datepicker('disable');   

       
    
    $("#btnPrint").live('click',function(){
        $("#normal-screen").hide();
        $("#page-header").hide();
        /*$("#searchdata").hide();*/
        $(".toolbar-box").hide();
        $("#foolter_table").hide();
        $("#leftboder").hide();
        $("#rightboder").hide();
        window.print();
        
        $("#normal-screen").show();
        $("#page-header").show();
        $("#searchdata").show();
        $(".toolbar-box").show();
        $("#foolter_table").show();
        $("#leftboder").show();
        $("#rightboder").show();
    });         
});
</script>
<style>
    a:hover{
        text-decoration:underline;
    }
    .sort{
        cursor:pointer;
    }
</style>
<FORM id="Act" action="" method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 
<INPUT type=hidden value="desc" id="ord" name="ord"> 

<table width="1026" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" id='leftboder' style='border-left:1px solid #ccc;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
                            <td>
 
                            </td>
                                <td>
                                <a href="javascript:void('0');" title="Print" id="btnPrint">
                                <span class="icon_Print"></span>Print
                                </a>
                            </td>
                        </tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/home_article.png);">
                     
                            Administrator
                       
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                </div>
                <div class="m">
                    <table width="100%" id='searchdata' border="0">
 
                        <tr>
                            <td width="10%" class="fontSearch" style="padding-left:20">
                               &nbsp; &nbsp;  วันที่สั่ง : 
                            </td>
                            <td align=left >
                                 <input id="txtOrderFrom"  title="Filter by Order Date " value="<?php  echo $_s_date;?>" type="text" size=10 name="txtOrderFrom" class="boxItem" />
                                &nbsp;- <input id="txtOrderTo"  title="Filter by Order Date " value="<?php  echo $_e_date;?>"  type="text" size=10 name="txtOrderTo" class="boxItem" />
                            </td>
                           
                         </tr>
                        
                     
                       <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20;padding-top:5px;">
                           &nbsp;&nbsp;&nbsp; สถานะ : 
                            </td>
                            <td  align=left style="padding-top:5px;">
                            <select id="cboStatus" style="width:10em;">
                                <option value="4">ทั้งหมด</option>
                                <option value="0">รอจ่ายเงิน</option>
                                <option value="1">รอส่งของ</option>
                                <option value="2">ปิดการขาย</option>
                                <option value="3">ยกเลิก</option>
                            </select>
                            </td>
                             
                         </tr>                       
                       
                        <tr>
                            <td>
                                No. row: <input type='text' id="txtPage" size="3" maxlength="3" style='text-align: right;' value="<?php echo $list_page;?>" />
                            </td>
                            <td style="color:#999;display:block;" width="98%">
                                <table width="100%" cellspacing="0" cellpadding="0" border="0"  >
                                <tr>
                                    <td>
                                        <span align="left" width="50%">
                                        <a href="javascript:void('0');" id="btnSearch"><image src="./images/btn-search.gif" border=0/></a> 
                                        </span>
                                    </td>
                                    <td align='right'>
                                         
                                    </td>
                                </tr>
                                </table>
                            </td>
                             
                        </tr>
                         <tr>
                            <td colspan="2">
                         </tr>
                    </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
                        
                            <th width="3%">#</th>
                            <th style="display:none">id</th>
                            <th style="display:none">status</th>
                            <th class="title" width="10%" ><a id="order_id" class="sort">หมายเลขสั่งซื้อ</a></th>
                            <th class="title" width="20%" ><a id="email" class="sort">อีเมล์สมาชิก</a></th>
                            <th class="title" width="25%">ส่งถึง</th>
                            <th  class="title" width="10%" nowrap="nowrap"><a id="totalsize" class="sort">ขนาด (GB)</a></th>
                            <th  class="title" width="10%" nowrap="nowrap"><a id="status" class="sort">สถานะ</a></th>
                            <th  class="title" width="10%" nowrap="nowrap"><a id="adddate" class="sort">วันที่สั่ง</a></th>
                            <th  class="title" width="5%" nowrap="nowrap">ส่งออก</th>  
                            <th  class="title" width="5%" nowrap="nowrap">ยกเลิก</th>                        
                       </tr>
                    </thead>
                   <tbody>
                     </tbody>
                     <tfoot>
                         <tr>
                            <td colspan="10">
                                <div class="boxfooter">
                                        <div id="paging_btn"></div> 
                                 <div class="totalpage2">Total : <span id="rowCount">0</span>&nbsp;&nbsp;rows</div>

                                </div>
                            </td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder'  style="border-right:1px solid #ccc;">&nbsp;</td>
  </tr>
</table>
 </FORM>
 
 
    <div id='dialog-update'title="เปลี่ยนสถานะ" >
     
        <table cellpadding='2' cellspacing='5' border='0' width='100%' class='fieldset'>
        <tr>
            <td><input type="radio" name="status" value="0" />รอจ่ายเงิน</td>
        </tr>
        <tr>
            <td><input type="radio" name="status" value="1" />รอส่งของ</td>
        </tr>
        <tr>
            <td><input type="radio" name="status" value="2" />ปิดการขาย</td>
        </tr>   
         <tr>
            <td><input type="radio" name="status" value="3" />ยกเลิก</td>
        </tr>    
        </table>
     
    </div>
      
     <div id="dialog-confirm" title="Confirm?" style="padding-top:20px;">
        <p style="font-size:13px"><span class="ui-icon ui-icon-alert" 
            style="float:left; margin:0 7px 20px 0;">
            </span>คุณต้องการยกเลิกรายการ</p>
    </div>
<?php echo footer();?>